home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 588 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.1 KB

  1. Path: chronicle.mti.sgi.com!austern
  2. From: tom@ssd.hcsc.com (Tom Horsley)
  3. Newsgroups: comp.std.c++
  4. Subject: Who gets out of memory exception?
  5. Followup-To: comp.std.c++
  6. Date: 28 Feb 1996 13:18:52 PST
  7. Organization: Harris Computer Systems Corporation
  8. Approved: austern@isolde.mti.sgi.com
  9. Message-ID: <TOM.96Feb28161011@amber.ssd.csd.harris.com>
  10. Reply-To: Tom.Horsley@hawk.hcsc.com
  11. NNTP-Posting-Host: isolde.mti.sgi.com
  12. X-Original-Date: 28 Feb 1996 21:10:11 GMT
  13. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  14.     iQBVAwUBMTTGyUy4NqrwXLNJAQFiwwIAn7yJD3pLL0Adiw/nHAeyVWOluiN2mhAR
  15.     iuFFkHxpLnREQByb+9r2Je03d346fAfcvw+3e1Ug0KCR82qDWPzEqg==
  16.     =St0+
  17. Originator: austern@isolde.mti.sgi.com
  18.  
  19. Someone showed me the "function try blocks" in the draft standard today, and
  20. I immediately began to wonder what happens if the function in question is
  21. a constructor and one of the exceptions I catch is "out of memory". If I
  22. have something like:
  23.  
  24. Fred::Fred(...) try : initializers... {
  25.    code goes here...
  26. } catch ...
  27.  
  28. And then I say "new Fred" and run out of memory.
  29.  
  30. I know some existing C++ implementations call the memory allocation code from
  31. inside the constructor and others call it from the place in the code where
  32. 'new' was invoked. So in different implementations today, the exception
  33. might actually occur in the caller or the constructor itself.
  34.  
  35. Does the standard say who gets the memory exception? Or is running out of
  36. memory even an exception? Or is this simply left undefined?
  37. --
  38. --
  39. Tom.Horsley@mail.hcsc.com
  40. Home: 511 Kingbird Circle Delray Beach FL  33444
  41. Work: Harris Computers, 2101 W. Cypress Creek Rd. Ft. Lauderdale FL  33309
  42. Support Project Vote Smart! They need your support in non-election years too!
  43. (email pvs@neu.edu, 1-800-622-SMART, http://www.vote-smart.org)
  44. ---
  45. [ comp.std.c++ is moderated.  To submit articles: Try just posting with your 
  46.                 newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  47.   comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  48.   Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  49.   Comments? mailto:std-c++-request@ncar.ucar.edu 
  50. ]
  51.